import React, { Component } from 'react'
import MyContext from "./context";

export default class ChildCom3 extends Component {

    static contextType = MyContext;

    render() {
        return (
            <div
                style={{
                    border: '1px solid',
                    width: "200px",
                    userSelect: 'none'
                }}
                onClick={()=>this.context.setCount(this.context.count + 2)}
            >
                ChildCom3  
                <div>count:{this.context.count}</div>
                <div>name:{this.context.name}</div>
            </div>
        )
    }
}